package com.zhongwang.business.module.baseCostManage.service;

import com.zhongwang.business.module.baseCostManage.dao.ProjectCostDao;
import com.zhongwang.business.module.baseCostManage.model.ProjectCostModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProjectCostService {
    @Autowired
    private ProjectCostDao projectCostDao;

    /**
     * 计划单编辑查询页面
     * @param model
     * @return
     */
    public List<ProjectCostModel> selectProjectCostList(ProjectCostModel model){
        return  projectCostDao.selectProjectCostList(model);
    }

    /**
     * 确认单编辑查询页面
     * @param model
     * @return
     */
    public List<ProjectCostModel> selectProjectCostHSList(ProjectCostModel model){
        return  projectCostDao.selectProjectCostHSList(model);
    }

    /**
     * 计划单编辑子列表
     * @param model
     * @return
     */
    public List<ProjectCostModel> selectCostSubList(ProjectCostModel model){
        /**
         * 类型的中文 1机械 2自动化 3流体 designTypeZH
         */
        if(model.getDesignType()==1){
            model.setDesignTypeZH("机械");
        }else if(model.getDesignType()==2){
            model.setDesignTypeZH("自动化");
        }else if(model.getDesignType()==3){
            model.setDesignTypeZH("流体");
        }
        return  projectCostDao.selectCostSubList(model);
    }
}
